package vcexam;

import java.text.DateFormat;
import java.text.ParseException;

class A{
	public String doit(int a, int b){
		return "a";
	}
	public String doit(int... vals){
		return "b";
	}
}



public class Date {

	public static void main(String[] args) {
		/* Exam D.
		 *  
		 * 1.
		 */
		java.util.Date d = new java.util.Date();
		String ds = "December 15, 2004";
		DateFormat df = DateFormat.getDateInstance();
		try{
			d = df.parse(ds);
		}catch(ParseException pe){
			System.out.println("Unable to parse = "+ ds);
		}
		((java.util.Date) d).setTime((1000 * 60 * 60 *24) + ((java.util.Date) d).getTime());
		
		/* 2.  */
		
		Integer x = 400;
		Integer y = x;
		x++;
		System.out.println("y = "+y);
		System.out.println("x = "+x);
		System.out.println((x==y)); // false ... cambia la referencia de x
		
		StringBuilder sb1 = new StringBuilder("123");
		StringBuilder sb2 = sb1;
		
		sb1.append("5");
		System.out.println("sb2 = "+sb2);
		System.out.println("sb1 = "+sb1);
		System.out.println((sb1 == sb2)); // True, ambos tienen la misma referencia, 
										  // aunque sb1 aumneto un valor mas, ambos actualizaron su valor
		
		
		/* 3. */
		//Integer i = args[0]; // Error de compilacion, no puede convertir de String a Integer
		int j = 12;
		//System.out.println("" + (j==i) + "that j==i.");
		
		A a = new A();
		System.out.println((a.doit(4, 5)));
		
		
		
	}
	
}
